﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Ana_Form
{
    public partial class Form_DepoGirdisi1 : Form
    {
        public Form_DepoGirdisi1()
        {
            InitializeComponent();
        }

           DepodataDataContext db;
        Depo depo;
        public Form_DepoGirdisi1(ref DepodataDataContext DB)
        {
            InitializeComponent();
            db = DB;
        }


        public Depo Depo
        {
            get { return depo; }
            set { depo = value; }
        }

        private void btniptal_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void btntamam_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }


        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (rddepo.Checked == true)
            {
                FormDepoGirisi();
            }
            else
            {
                FormPersonelGirisi();
            }
        }
        private void FormPersonelGirisi()
        {
            lbl1.Enabled = true;
            lbl2.Enabled = true;
            lbl3.Enabled = true;
            txtsicilno.Enabled = true;
            txtsoyadi.Enabled = true;
            txttel.Enabled = true;
            lblilgili.Location = new Point(11, 153);
            txtilgilikisi.Location = new Point(95, 150);
            this.Size = new Size(275, 250);

        }
        private void FormDepoGirisi()
        {
            lbl1.Enabled = false;
            lbl2.Enabled = false;
            lbl3.Enabled = false;
            txtsicilno.Enabled = false;
            txtsoyadi.Enabled = false;
            txttel.Enabled = false;
            lblilgili.Location = new Point(11, 75);
            txtilgilikisi.Location = new Point(95, 72);
            this.Size = new Size(275, 165);
        }

        private void txtadi_TextChanged(object sender, EventArgs e)
        {
            if (txtadi.Text == "")
            {
                btntamam.Enabled = false;
            }
            else
            {
                btntamam.Enabled = true;
            }
        }

        private void Form_DepoGirdisi1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                btniptal_Click(null, null);
            }

        }



    }
}
